/**
 * Created by Amaris on 2016/12/6.
 */

var express = require('express');
var router = express.Router();
var stockCtrl = require('../../controller/controller.dic-stock.js');

router.get('/getStockList', function (req, res, next) {
    stockCtrl.getList(req.query, function (err, result) {
        if (err) throw err;
        res.send(result);
    });
});
router.get('/getAllStockList', function (req, res, next) {
    stockCtrl.getAllList(req.query, function (err, result) {
        if (err) throw err;
        res.send(result);
    });
});
router.post('/createStock', function (req, res, next) {
    stockCtrl.create(req.body, function (err, result) {
        if (err) throw err;
        res.send(result);
    });
});
router.get('/getStockListInStockPool', function (req, res, next) {
    stockCtrl.getStockListInStockPool(req.query, function (err, result) {
        if (err) throw err;
        res.send(result);
    });
});
router.get('/getStockByCode', function (req, res, next) {
    stockCtrl.getStockByCode(req.query, function (err, result) {
        res.send(result);
    });
});


module.exports = router;
